#include <ctime>

auto start = clock();
/* do_something(); */
auto end = clock();

cout << "do_something costs " << (double)(end - start)* 1.0 / CLOCKS_PER_SEC << " seconds" << endl;